<template>
  <div class="hot">
    <p><i class="el-icon-trophy"></i> 热门赛事</p>
    <div class="hot_con">
      <a :href="item.match_url" class="hot_list" v-for="item in hotmatch" :key="item.hotId">
        <img :src="item.match_photo" alt="" />
        <div class="hot_title" v-if="item.match_status == 1">
          {{ item.hot_match }}
        </div>
        <div class="hot_title2" v-else>
          {{ item.hot_match }}
        </div>
        <span class="hot_start" v-if="item.match_status == 1">
          <span class="pop-splite" style=""></span>
          进行中
        </span>
        <span class="hot_start2" v-else>
          已结束
        </span>
      </a>
    </div>
  </div>
</template>
<script>
export default {
  data: () => ({
    hotmatch: []
  }),
  created () {
    this.gethot()
  },
  methods: {
    async gethot () {
      const data = await this.$axios.get('/match/hotmatchdata')
      this.hotmatch = data.data
      // console.log(this.hotmatch)
    }
  }
}
</script>
<style lang="less" scoped>
.hot {
  width: 800px;
  p {
    border-bottom: 2px solid #ddd;
    font-size: 20px;
    padding-bottom: 10px;
  }
  .hot_con {
    width: 100%;
    height: 280px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    .hot_list {
      width: 260px;
      height: 130px;
      position: relative;
      .hot_title,
      .hot_title2 {
        width: 100%;
        height: 30px;
        position: absolute;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        line-height: 30px;
        text-indent: 20px;
        color: #f3c258;
      }
      .hot_title2 {
        color: #fff;
      }
      .hot_start,
      .hot_start2 {
        height: 20px;
        display: inline-block;
        font-size: 12px;
        background: url(//game.gtimg.cn/images/yxzj/match/center2018/images/pop-start.png) no-repeat;
        width: 64px;
        text-align: center;
        line-height: 20px;
        right: 10px;
        top: 10px;
        color: #363636;
        overflow: hidden;
        position: absolute;
        .pop-splite {
          width: 1.5px;
          background: #fff;
          transform: rotate(10deg);
          left: -10px;
          height: 20px;
          position: absolute;
        }
      }
      .hot_start2 {
        background: url(//game.gtimg.cn/images/yxzj/match/center2018/images/pop-notyet.png) no-repeat;
      }
    }
  }
  .hot_list:hover .pop-splite {
    animation: swiper 1.5s infinite linear;
    @keyframes swiper {
      from {
        left: -10px;
      }
      to {
        left: 120px;
      }
    }
  }
}
</style>
